package cn.hl.sfzy.service.impl;

import cn.hl.sfzy.entity.Consultlevel;
import cn.hl.sfzy.mapper.ConsultlevelMapper;
import cn.hl.sfzy.service.ConsultLevelService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Date 2024年10月23日
 */
//取消所有黄色警告
//@SuppressWarnings("all")
@Service
public class ConsultLevelServiceImpl implements ConsultLevelService {
    @Autowired
    private ConsultlevelMapper consultlevelMapper;

    @Override
    public int add(Consultlevel consultlevel) {
        return consultlevelMapper.insert(consultlevel);
    }

    @Override
    public int remove(Long[] id) {
        return consultlevelMapper.remove(id);
    }

    @Override
    public int edit(Consultlevel consultlevel) {
        return consultlevelMapper.updateByPrimaryKeySelective(consultlevel);
    }

    public List<Consultlevel> find(Consultlevel consultlevel) {
        return consultlevelMapper.find(consultlevel);
    }

    @Override
    public PageInfo<Consultlevel> findByPage(int pageNum, int pageSize, Consultlevel consultlevel) {
        PageHelper.startPage(pageNum, pageSize);
        List<Consultlevel> consultlevels = consultlevelMapper.find(consultlevel);
        return new PageInfo<>(consultlevels);
    }
}
